<template>
    <div>
        {{$store.state.name}}
        <button @click="change">改名</button>
    </div>
</template>

<script>
    export default {

        data() {
            return {

            };
        },

        mounted() {
            var name = this.$store.state.name;
            var age = this.$store.getters.filterAge;
            debugger;
        },

        methods: {
            change(){
                this.$store.dispatch('changeName');
            }
        },
    };
</script>